<!-- 表头修改个人信息与密码 -->
<template>
   <el-dropdown @command="personal">
      <span class="el-dropdown-link" style=" margin-right: 10px;"><el-avatar :size="28" :src="avatarUrl"> user </el-avatar></span>
      <template #dropdown>
         <el-dropdown-menu>
            <el-dropdown-item :icon="User" :command="0">个人信息</el-dropdown-item>
            <el-dropdown-item :icon="Lock" :command="1">密码修改</el-dropdown-item>
            <el-dropdown-item :icon="Right" :command="2">退出登陆</el-dropdown-item>
         </el-dropdown-menu>
      </template>
   </el-dropdown>
</template>
<script setup lang="ts">
import { Lock, Right, User } from '@element-plus/icons-vue'
import { useRouter } from 'vue-router';
import { useUserstore } from '@/stores/counter'
const store = useUserstore()
const router=useRouter()
let {avatarUrl}=store.user
const personal = (v: number) => {
   switch (v) {
      case 0:
      router.push('/index/userinfo')//跳转个人信息路由
         break;
      case 1:
      router.push('/index/updateadmin')//跳转修改密码路由
         break;
      case 2:
      store.loginout()//退出登录
         break;

      default:
         break;
   }

}
</script>